package com.eight.statistics.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.eight.statistics.dao.OrderDao;
import com.eight.statistics.pojo.Order;
import com.eight.statistics.service.OrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: qy8-education
 * @description:
 * @author: 郑友民（1460115388@qq.com）
 * @create: 2023-05-28 19:19
 **/
@Service
public class OrderServiceImpl implements OrderService {
    @Resource
    private OrderDao orderDao;

    @Override
    public List<Order> queryAllOrderBang(Order order) {
        QueryWrapper<Order> wrapper = new QueryWrapper<>();
        if (order.getGmtCreate() != null) {
            wrapper.ge("gmt_create", order.getGmtCreate());
        }
        if (order.getGmtModified() != null) {
            wrapper.le("gmt_create", order.getGmtModified());
        }
        wrapper.eq("is_deleted", 0);
        List<Order> orderBangs = orderDao.queryAllOrderBang(wrapper);
        return orderBangs;
    }
}

